import app
import requests

class BaseQuery:
    def __init__(self,path):
        self.session = requests.session()
        self.url = 'https://{}'.format(app.base_url)+ path


    def Base_postquery(self,run,data,header):
        return self.session.post(url=self.url,json = data, headers = header)



if __name__ == '__main__':
    path ="/openapi/mid/mid-end-im-chat/v1/notice"
    run = "R"
    data = {"memberID": "5914812","source": 1,"channelSource": 17,"noticeType": 0}
    header = {'Content-Type':'application/json','Authorization':'Bearer qgbA4GZee87a1b2-dbc5-479a-a02a-1f65c8e0069a.dSAZ_bU0-TMli0Xmbmqk4_2j48dfeQWfZJxjKirW_p3","X-Token":"eyJraWQiOiJwdWJsaWM6YWRkMjQxNGItMDFiYS00MjFkLTkxOGEtYjQ2MGE3ODcyMzRhIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIzZjU5NmY0YmFhNjI0ODVlODQxZTM5ZDkwOTQxM2ZlOCIsImF1ZCI6ImE3MmNhMWU4LTI0Y2UtNGQzZi04MDJiLTE3ZDM3Njg4YjFiYiIsImF1dGhfdGltZSI6MTY4MTE4MjY5MSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6ODA4MC9jYWxsYmFjayIsImV4cCI6MTY4MTE4NjI5MSwiaWF0IjoxNjgxMTgyNjkxLCJqdGkiOiI3OTM5MTQyZS1iMDdjLTQxNzItYmQ5Zi01NmQxNTdlYjc0NzEifQ.J89ziwcWsKPVcR5Wwpu8rOt5sir-6oSCShVKjiIorLx5x6TPIYq9zYOctdj3A841SzDtRAQY2MjQHM5NDLzDFdCbc9BqyRnFmtuo3QaLK0_Jnsw9SvfrVwJyiEgrJ1oDmIysokxGpGYgqDR2KkKsoQ8Jm_uB9eEtRtilARb4XTKHL9GBNi8lAVuWO0QqzTeOALzbmY4QQMHNPrkM4MjXCgespQxFIlVIh0Yg_NwT5fG14dSV9M5gm6zWftixsriAVWnP3D0WgBl2bG0mGW93G2TI1ZPNI3KQUlgetq4_PWjtKKki3HSIjNvcD2nunNVh5cA4qkk8ifkK3Jt85NKPqA'}
    print(BaseQuery(path).Base_postquery(run, data, header).text)